package com.dong.javalangchain4jai.config;

import com.dong.javalangchain4jai.service.ChatAssistant;
import com.dong.javalangchain4jai.util.SpringContextUtil;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.service.AiServices;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {

    @Bean
    public ChatAssistant chatAssistant() {
        ChatLanguageModel model = SpringContextUtil.getBean("deepseek-chat", ChatLanguageModel.class);
        return AiServices.builder(ChatAssistant.class)
                .chatLanguageModel(model)
                .build();
    }

}
